<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>css(name|pro|[,val|fn])</title>
<link type="text/css" rel="stylesheet" href="style/style.css" tppabs="http://www.erdangjiade.com/manual/jquery/jquery/style/style.css"  />
</head>
<body id="split">
<div id="content">
  <div rel="css">
    <h2><span>返回值:String</span>css(name|pro|[,val|fn])</h2>
    <h3>概述</h3>
    <div class="desc">
      <p>访问匹配元素的样式属性。</p>
      <div class="longdesc">
        <p></p>
      </div>
    </div>
    <h3>参数</h3>
    <div>
      <h4><strong>name</strong><span>String</span><em>V1.0</em></h4>
      <p>要访问的属性名称</p>
      <h4><strong>properties</strong><span>Map</span><em>V1.0</em></h4>
      <p>要设置为样式属性的名/值对</p>
      <h4><strong>name,value</strong><span>String, Number</span><em>V1.4</em></h4>
      <p>属性名,属性值</p>
      <h4><strong>name,function(index, value)</strong><span>String,Function</span><em>V1.0</em></h4>
      <p>1:属性名</p>
      <p>2:此函数返回要设置的属性值。接受两个参数，index为元素在对象集合中的索引位置，value是原先的属性值。</p>
    </div>
    <div class="example">
      <h3>示例</h3>
      <span id="f_ad2"></span>
      <h4>参数name 描述:</h4>
      <p>取得第一个段落的color样式属性的值。</p>
      <h5>jQuery 代码:</h5>
      <pre><code>$("p").css("color");</code></pre>
      <h4>参数properties 描述:</h4>
      <p>将所有段落的字体颜色设为红色并且背景为蓝色。</p>
      <h5>jQuery 代码:</h5>
      <pre><code>$("p").css({ color: "#ff0011", background: "blue" });</code></pre>
            <h4>参数name,value 描述:</h4>
      <p>将所有段落字体设为红色</p>
      <h5>jQuery 代码:</h5>
      <pre><code>$("p").css("color","red");</code></pre>
            <h4>参数name,回调函数 描述:</h4>
      <p>逐渐增加div的大小</p>
      <h5>jQuery 代码:</h5>
      <pre><code>  $("div").click(function() {
    $(this).css({
      width: function(index, value) {
        return parseFloat(value) * 1.2;
      }, 
      height: function(index, value) {
        return parseFloat(value) * 1.2;
      }
    });
  });</code></pre>
    </div>
  </div>
</div>
</body>
</html>
<div style="display:none">

<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F327b016d332d3a7e4043796cab725707' type='text/javascript'%3E%3C/script%3E"));
</script>
</div>i